<script type="text/javascript">
    function edit(id)
    {
        window.location = "<?php echo Utility::getSiteUrl();?>/user/edit/" + id;
    }
</script>
<fieldset>
    <legend>Tìm người dùng</legend>
    <form action="<?php echo Utility::getSiteUrl();?>/user/find" method="post">
    <table border="1" style="width:500px;" cellpadding="2px;">
        <tr>
            <td style="padding-left:10px">Mã thành viên</td>
            <td style="padding-left:10px"><input type="text" name="user_id" value="<?php echo (isset($search['user_id'])?$search['user_id']:"");?>" style="width:80%"/></td>
        </tr>
        <tr>
            <td style="padding-left:10px">Tên thành viên</td>
            <td style="padding-left:10px"><input type="text" name="user_name" value="<?php echo (isset($search['user_name'])?$search['user_name']:"");?>" style="width:80%"/></td>
        </tr>
        <tr>
            <td colspan="2">
                <input type="submit" name="submit" value="Tìm kiếm" />
                <input type="reset" value="Nhập lại"/>
            </td>
        </tr>
    </table>
    </form>
    <br /><br/>
    <?php
        if(isset($result))
        {
            $size = $result->getSize();
            if($size > 0)
            {
        ?>
            <table border="1">
                <tr>
                    <th>Mã người dùng</th>
                    <th>Tên người dùng</th>
                    <th colspan="2"></th>
                </tr>
                <?php
                for($i = 0; $i < $size; $i++)
                {
                    $row = $result->getRow($i);
                    ?>
                    <tr>
                        <td><?php echo $row->id;?></td>
                        <td><?php echo $row->name;?></td>
                        <td><input type="button" value="Sửa" onclick="edit(<?php echo $row->id;?>)" /></td>
                        <td><input type="button" value="Xóa" onclick="remove(<?php echo $row->id;?>)"/></td>
                    </tr>
                    <?php
                }
                ?>
            </table>
        <?php
            }
        }
        ?>
</fieldset>